package com.catclay.adultmoon.dao;

import com.catclay.adultmoon.pojo.ShopPlatform;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.HashMap;

@Repository
public class ShopPlatformDao {

    private static HashMap<Integer, ShopPlatform> shopPlatforms = null;

    static {
        shopPlatforms = new HashMap<Integer, ShopPlatform>();
        shopPlatforms.put(1,new ShopPlatform(1,"jd"));
        shopPlatforms.put(2,new ShopPlatform(2,"tb"));
        shopPlatforms.put(3,new ShopPlatform(3,"pdd"));

    }

    public Collection<ShopPlatform> getAllShopPlatform(){
        return shopPlatforms.values();
    }

    public ShopPlatform getShopPlatformById(Integer id){
        return shopPlatforms.get(id);
    }

    public void delete(Integer id){
        shopPlatforms.remove(id);
    }

    public void add(ShopPlatform shopPlatform){
        shopPlatforms.put(shopPlatform.getId(), shopPlatform);
    }
}
